package com.wkb.webService.call;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

/**  
 * @author wkb 
 * @version 创建时间：2013-6-27 下午4:30:43  
 * 类说明
 */
public class AxisCallService {

	public static void main(String[] args) {
		
//		String str1 = "http://192.168.64.100:8080/eos-default/IUumsDeptService?wsdl";
//		String str2 = "getDept";
//		String str3 = "Depuums_2012@#";
//		String str5 = "13";
//		ServiceUtil.callScaService(str1, str2, str3,str5);
		
		  try {
              String endpoint = "http://192.168.64.100:8080/eos-default/IUumsDeptService?wsdl";
              //直接引用远程的wsdl文件
             //以下都是套路 
              Service service = new Service();
              Call call = (Call) service.createCall();
              call.setTargetEndpointAddress(endpoint);
              call.setOperationName("getDept");//WSDL里面描述的接口名称
              call.addParameter("in0", org.apache.axis.encoding.XMLType.XSD_DATE,
                            javax.xml.rpc.ParameterMode.IN);//接口的参数
              call.addParameter("in1", org.apache.axis.encoding.XMLType.XSD_DATE,
                      javax.xml.rpc.ParameterMode.IN);//接口的参数
              call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型  
              String temp = "Depuums_2012@#";
              String result = (String)call.invoke(new Object[]{temp,"13"});
              //给方法传递参数，并且调用方法
              System.out.println("result is "+result);
       }
       catch (Exception e) {
              System.err.println(e.toString());
       }
	}
	
}
